package com.ant.storage.pojo;

import com.ant.storage.vo.WarehouseAndCommodityVo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author melon
 * @since 2022-03-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="Warehouse对象", description="")
public class Warehouse implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("parent_id")
    private Integer parentId;

    @TableField("city_id")
    private Integer cityId;

    @TableField("dept_id")
    private Integer deptId;

    @NotNull(message="仓库名称不能为空")
    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "仓库说明")
    @TableField("warehouse_explain")
    private String warehouseExplain;

    @ApiModelProperty(value = "仓库地址")
    @TableField("warehouse_adderss")
    private String warehouseAdderss;

    @NotNull(message="仓库名称不能为空")
    @ApiModelProperty(value = "仓库负责人")
    @TableField("warehouse_principal")
    private String warehousePrincipal;

    @NotNull(message="仓库名称不能为空")
    @ApiModelProperty(value = "负责人电话")
    @TableField("warehouse_tel")
    private String warehouseTel;

    @ApiModelProperty(value = "是否默认")
    @TableField("warehouse_default")
    private boolean warehouseDefault;

    @ApiModelProperty(value = "是否调拨")
    @TableField("warehouse_transfer")
    private boolean warehouseTransfer;

    @ApiModelProperty(value = "仓库等级")
    @TableField("warehouse_grade")
    private String warehouseGrade;

    @TableField("creator_by")
    private String creatorBy;

    @TableField("creation_time")
    private Date creationTime;

    @TableField(exist = false)
    private List<Warehouse> children;

    @ApiModelProperty(value = "仓库出入记录")
    @TableField(exist = false)
    private List<WarehouseAndCommodityVo> inventoryLogs;

    @ApiModelProperty(value = "仓库物品记录")
    @TableField(exist = false)
    private List<WarehouseAndCommodityVo> inventoryList;


    @ApiModelProperty(value = "总数")
    @TableField(exist = false)
    private  Integer total;


    @ApiModelProperty(value = "出库统计")
    @TableField(exist = false)
    private  Integer outboundCount;

    @ApiModelProperty(value = "入库统计")
    @TableField(exist = false)
    private  Integer warehousingCount;

    @ApiModelProperty(value = "出入明细")
    @TableField(exist = false)
    private List<InventoryLog> detailsList;
}
